Conversation
Current state: nodes.py contains only data types. processor.py contains all resolution logic. Current separation is clean — nodes.py is "output types" and processor.py is "template resolution." Moving Node processing logic into nodes.py would blur this(eventually if not immediate) |
|
Why change API signature, html -> to_html ? i would not mind html -> H atleast terse name collisions? but, then one can always do import html as to_html |
this breaks {condition and template} or {condition and some_func() } which pretty common used in templating. |
…on non-none returns.
…d some missing annotations.
|
@davepeck @pauleveritt Can you guys take another look at this when you get a chance? It is a very large conceptual change RE: the component signature and the default processor. I walked back the more ambitious pre-compiled template concept and now both processors are using The interpolation value options are more strict because I was trying to makes the rules more well defined. |
|
Thanks for all the work @ianjosephwilson I'll see if @davepeck has time this week to go through it together. (Dave: Any afternoon/evening my time is fine.) |
|
@ianjosephwilson Thank you for this -- I think I have time this week to re-focus energies and read over in more detail. How does this PR relate to the other open and draft PRs we currently have? (@AhnafCodes -- thank you for hopping in here, and nice to have you on board! I agree that |
@davepeck At this point it might be easier to just browse the processor.py and processor_test.py files instead of diffs to get a feel for what changed. I think these are the major things:
|
|
@davepeck Would it be easier if I broke some of the smaller less related pieces out of this and we merged those first? |
davepeck
left a comment
There was a problem hiding this comment.
@davepeck Would it be easier if I broke some of the smaller less related pieces out of this and we merged those first?
I'm sort of working through it in one fell swoop right now. Thanks for all the guide posts here. I do think there are some separable pieces we could consider teasing apart into separate PRs, but I dunno... that may be more work than it's worth.
nodes/nodes/processor.pynodes.pyintonodes/nodes.pyTemplateso the actual contents are not processed until after the component is invoked.to_html(t'<div>{(lambda: "dynamic")}</div>') != '<div>dynamic</div>'callbackcan be used which then interpolates the return valueto_html(t'<div>{(lambda: "dynamic"):callback}</div>') == '<div>dynamic</div>'to_html(t'<div>{False}</div>') == "<div>False</div>"Noneis still ignored:to_html(t'<div>{None}</div>') == "<div></div>"